{extend name='admin@main'}

{block name="button"}
<!--{if auth("currency/cities/add_house")}-->
<button data-open='{:url("add_house")}' data-title="添加小区" class='layui-btn layui-btn-sm layui-btn-primary'>添加小区</button>
<!--{/if}-->

{/block}
{block name="content"}
<div class="think-box-shadow">
    {include file='cities/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>名称</th>
            <th class='text-left nowrap'>编码</th>
            <th class='text-center nowrap'>经纬度</th>
            <th class='text-center nowrap'>联系人</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>

                <a data-open='{:url("index")}?pid={$vo.id}'>{$vo.name|default=''}</a>
            </td>
            <td class='text-left nowrap'>{$vo.adcode|default='-'}</td>
            <td class='text-center nowrap'>{$vo.center|default='-'}</td>
            <td class="text-center nowrap">{$vo.contact_name}-{$vo.contact_phone}</td>
            <td class='text-left nowrap'>

                {if auth("currency/cities/add")}
                <span class="text-explode">|</span>
                <!--{if $vo.level == 'street' || $vo.level == 'district' || $vo.level == 'custom'}-->
                <a class="layui-btn layui-btn-sm layui-btn-primary" data-title="添加地址" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
                <!--{else}-->
                <a class="layui-btn layui-btn-sm layui-btn-disabled">添 加</a>
                <!--{/if}-->
                {/if}

                {if auth("currency/cities/edit")}
                <span class="text-explode">|</span>
                <!--{if $vo.level == 'custom'}-->
                <a class="layui-btn layui-btn-sm" data-title="编辑地址" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                <!--{else}-->
                <a class="layui-btn layui-btn-sm layui-btn-disabled">编 辑</a>
                <!--{/if}-->
                {/if}

                {if $vo.status eq 1 and auth("currency/cities/forbid")}
                <span class="text-explode">|</span>
                <!--{if $vo.level == 'custom'}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('currency/cities/forbid')}">禁 用</a>
                <!--{else}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm layui-btn-disabled" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('currency/cities/forbid')}">禁 用</a>
                <!--{/if}-->
                {elseif $vo.status eq 0 and auth("currency/cities/resume")}
                <span class="text-explode">|</span>
                <!--{if $vo.level == 'custom'}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('currency/cities/resume')}">启 用</a>
                <!--{else}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm layui-btn-disabled" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('currency/cities/resume')}">启 用</a>
                <!--{/if}-->
                {/if}

                {if auth("currency/cities/remove")}
                <span class="text-explode">|</span>
                <!--{if $vo.level == 'custom'}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该地址吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('currency/cities/remove')}">删 除</a>
                <!--{else}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger layui-btn-disabled" data-confirm="确定要删除该地址吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('currency/cities/remove')}">删 除</a>
                <!--{/if}-->
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
